Interface Formula

All Known Subinterfaces:
Expression
All Known Implementing Classes:
BooleanExpression, Conjunction, Constant, Disjunction, Fact, NAryBooleanExpression, Negation, Term, Variable

public interface Formula
Represents the superclass of all logical formulas.
Author:
Stephen G. Ware
  • Method Summary

    Modifier and Type Method Description
    Formula substitute​(Unifier unifier)
    Return a version of this formula with its variables replaced with the values assigned to them by a unifier.
    Unifier unify​(Formula other, Unifier unifier)
    Unify this formula with another formula, adding to a given unifier as needed to make the two expression the same.
  • Method Details

    • unify

      Unifier unify​(Formula other, Unifier unifier)
      Unify this formula with another formula, adding to a given unifier as needed to make the two expression the same. The unifier passed in as an argument will not be modified; the (possibly extended) unifier is be returned by this method.
      Parameters:
      other - the other logical formula to unify with
      unifier - the unifier to extend
      Returns:
      the new unifier that makes the two formulas the same, or null if they cannot unify
    • substitute

      Formula substitute​(Unifier unifier)
      Return a version of this formula with its variables replaced with the values assigned to them by a unifier.
      Parameters:
      unifier - the unifier
      Returns:
      the formula with variables replaced